﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BHair
{
    public partial class frmzhuce : Form
    {
        public frmzhuce()
        {
            InitializeComponent();
        }
        //SoftKeyYT88 ytsoftkey;
        public static string KeyPath;
        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void frmzhuce_Load(object sender, EventArgs e)
        {
           
             
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ///*注意!!!!，如果是普通单片机芯片，储存器的写次数是有限制的，写次数为1000次，读不限制，如果是智能芯片，写的次数为10万次*/
            ////写入字符串到加密锁中,使用默认的写密码
            //int ret;
            //int nlen;
            //String InString;
            //InString = textBox2.Text.Trim();
            //byte[] buf = new byte[1];
            //int addr = 0;//要写入的地址
            ////InString = "加密锁";
            ////nlen = SoftKeyYT88.lstrlenA(InString);
            //buf[0] = System.Convert.ToByte(nlen);

            ////写入字符串到地址1
            //ret = ytsoftkey.YWriteString(InString, addr + 1, "0D4A3296", "CB65AB67", KeyPath);
            //if (ret != 0)
            //{
            //    MessageBox.Show("写入字符串错误。错误码：" + ret.ToString()); return;
            //}
            ////写入字符串的长度到地址0
            //ret = ytsoftkey.YWriteEx(buf, addr, 1, "0D4A3296", "CB65AB67", KeyPath);
            //if (ret != 0)
            //    MessageBox.Show("写入字符串长度错误。错误码：" + ret.ToString());
            //else
            //    MessageBox.Show("写入字符串成功");
        }
    }
}
